package com.example.tse.rbhttpservice.service.moments.model;

import java.util.List;
import java.util.ArrayList;
import com.example.tse.rbhttpservice.service.RudderResponse;


//import com.rbyair.services.moments.model.MomentsHomeGetModules;
//import com.rbyair.services.moments.model.MomentsHomeGetRecommends;
//import com.rbyair.services.moments.model.MomentsHomeGetMoments;
/**
 * ［首页］：版块列表、达人推荐、帖子列表
［首页］版块列表：妈妈关心等［后台会维护］，只在首页显示版块，一般推荐2个版块，一个版块下显示2个活动
［首页］达人推荐：固定三条推荐的，默认最新添加的三条记录
［首页］帖子列表：同帖子列表
 * @author wliu
 * edit tse
 */
public class MomentsHomeGetResponse extends RudderResponse{
    
    private MomentsHomeGetModules modules = new MomentsHomeGetModules();
		
    
    private List<MomentsHomeGetRecommends> recommends = new ArrayList<MomentsHomeGetRecommends>();
		
    
    private List<MomentsHomeGetMoments> moments = new ArrayList<MomentsHomeGetMoments>();
		
	
    /**
     * @return modules
     */	
    public MomentsHomeGetModules getModules() { 
	    return this.modules;
    };
	
	/**
     * @return modules
     */	
    public void setModules(MomentsHomeGetModules modules) { 
        this.modules = modules;
    };
    
    /**
     * @return recommends
     */	
    public List<MomentsHomeGetRecommends> getRecommends() { 
	    return this.recommends;
    };
	
	/**
     * @return recommends
     */	
    public void setRecommends(List<MomentsHomeGetRecommends> recommends) { 
        this.recommends = recommends;
    };
    
    /**
     * @return moments
     */	
    public List<MomentsHomeGetMoments> getMoments() { 
	    return this.moments;
    };
	
	/**
     * @return moments
     */	
    public void setMoments(List<MomentsHomeGetMoments> moments) { 
        this.moments = moments;
    };
    
	
        
    private static void filterFor(MomentsHomeGetModulesActivities moments) {
        if (moments.getActivityId() == null) {
            moments.setActivityId("");
        }
        if (moments.getMainPic() == null) {
            moments.setMainPic("");
        }
        if (moments.getJoinNum() == null) {
            moments.setJoinNum("");
        }
    }
        
    private static void filterFor(MomentsHomeGetModules moments) {
        if (moments.getModuleId() == null) {
            moments.setModuleId("");
        }
        if (moments.getName() == null) {
            moments.setName("");
        }
        if (moments.getActivities() == null) {
            moments.setActivities(new ArrayList<MomentsHomeGetModulesActivities>());
        } else {
            for (MomentsHomeGetModulesActivities item : moments.getActivities()) {
                filterFor(item);
            }
        }
    }
        
    private static void filterFor(MomentsHomeGetRecommends moments) {
        if (moments.getMemberId() == null) {
            moments.setMemberId("");
        }
        if (moments.getAvatar() == null) {
            moments.setAvatar("");
        }
        if (moments.getNickname() == null) {
            moments.setNickname("");
        }
    }
        
    private static void filterFor(MomentsHomeGetMomentsTags moments) {
        if (moments.getX() == null) {
            moments.setX("");
        }
        if (moments.getY() == null) {
            moments.setY("");
        }
        if (moments.getTitle() == null) {
            moments.setTitle("");
        }
    }
        
    private static void filterFor(MomentsHomeGetMoments moments) {
        if (moments.getMomentsId() == null) {
            moments.setMomentsId("");
        }
        if (moments.getMemberId() == null) {
            moments.setMemberId("");
        }
        if (moments.getAvatar() == null) {
            moments.setAvatar("");
        }
        if (moments.getNickname() == null) {
            moments.setNickname("");
        }
        if (moments.getCreateTime() == null) {
            moments.setCreateTime("");
        }
        if (moments.getContent() == null) {
            moments.setContent("");
        }
        if (moments.getMainPic() == null) {
            moments.setMainPic("");
        }
        if (moments.getIsNoticed() == null) {
            moments.setIsNoticed("");
        }
        if (moments.getIsDeleted() == null) {
            moments.setIsDeleted("");
        }
        if (moments.getIsLiked() == null) {
            moments.setIsLiked("");
        }
        if (moments.getLikeNum() == null) {
            moments.setLikeNum("");
        }
        if (moments.getShareLink() == null) {
            moments.setShareLink("");
        }
        if (moments.getShareTitle() == null) {
            moments.setShareTitle("");
        }
        if (moments.getShareDescription() == null) {
            moments.setShareDescription("");
        }
        if (moments.getTags() == null) {
            moments.setTags(new ArrayList<MomentsHomeGetMomentsTags>());
        } else {
            for (MomentsHomeGetMomentsTags item : moments.getTags()) {
                filterFor(item);
            }
        }
    }
        
    public static void filter(MomentsHomeGetResponse moments) {
        if (moments.getModules() == null) {
            moments.setModules(new MomentsHomeGetModules());
        } else {
            filterFor(moments.getModules());
        }
        if (moments.getRecommends() == null) {
            moments.setRecommends(new ArrayList<MomentsHomeGetRecommends>());
        } else {
            for (MomentsHomeGetRecommends item : moments.getRecommends()) {
                filterFor(item);
            }
        }
        if (moments.getMoments() == null) {
            moments.setMoments(new ArrayList<MomentsHomeGetMoments>());
        } else {
            for (MomentsHomeGetMoments item : moments.getMoments()) {
                filterFor(item);
            }
        }
    }
}
